package com.dly.file;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class BufferedReaderTest {
	
	public static void main(String[] args) throws IOException {
		
		BufferedReader br=new BufferedReader(new FileReader("D:/a.txt"));
//		BufferedWriter bw=new BufferedWriter(new FileWriter("D:/c.txt"));
		BufferedWriter bw=new BufferedWriter(new FileWriter("D:/c.txt", true));
		
		
		
		String str=null;
		
		while((str=br.readLine()) != null){
//			System.out.println(str);
			System.out.print(str+"\n");
			bw.append(str);
			bw.newLine();
		}
		br.close();
		bw.close();
	}
}
